package com.newedu.equipmgr.dao;

import com.newedu.equipmgr.entity.AreaInfo;

import java.sql.SQLException;
import java.util.List;

/**
 * @author jerry
 * @create 2020-06-08 08:49:44
 * @company 新开普电子股份有限公司
 */
public interface AreaDao {
    /**
     * curd - 新增，修改，删除，查询
     * create update read delete
     * 分页查询，模糊查询
     */
    boolean insert(AreaInfo areaInfo) throws SQLException;
    boolean update(AreaInfo areaInfo) throws SQLException;
    boolean delete(int id) throws SQLException;
    AreaInfo selectOne(int id) throws SQLException;
    List<AreaInfo> selectAll() throws SQLException;

    /**
     * 按照楼栋号，进行模糊查询，并且可以进行分页操作,指定当前页码，以及分页的数据大小
     * @param condition
     * @return
     * @throws SQLException
     */
    List<AreaInfo> selectBy(String condition, int pageNum, int pageSize) throws SQLException;


    /**
     * 返回 当前表中所有的记录数，记录总数，分页操作用
     * @param condition
     * @return
     * @throws SQLException
     */
    int countRows(String condition)throws SQLException;

    List<String> selectAllBuilding() throws SQLException;

    List<AreaInfo> selectAreaInfoBy(String building) throws SQLException;


}
